package test.blued.com.casecontroller.webViews;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;

import test.blued.com.casecontroller.R;

/**
 * Created by mm on 2017-11-17.
 */

public class LogWebView extends Activity{
    private WebView localWeb;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.webview);
        Intent intent = getIntent();
        String htmlName = intent.getStringExtra("htmlName");
        localWeb = (WebView)findViewById(R.id.localWeb);
        localWeb.setWebViewClient(new WebViewClient(){
            @Override
            public boolean shouldOverrideUrlLoading(WebView view, String url) {
                view.loadUrl(url);
                return true;
            }
        });
        WebSettings webSettings = localWeb.getSettings();
        webSettings.setJavaScriptEnabled(true);
        localWeb.loadUrl("file:" + htmlName);
    }

}
